package thread;

public class SortPaoPao {
    public static void main(String[] args) {

        method();
    }

    private static void method() {
        int  temp;
        int []a={8,5,6,7,2,9,1};
        for (int i=0;i<a.length-1;i++){
            for (int j=0;j<a.length-1-i;j++){
                if (a[j]>a[j+1]){
                    temp=a[j];
                   a[j]=a[j+1];
                   a[j+1]=temp;
                }

            }


        }
        for (int i=0;i<a.length;i++){
            System.out.println("第"+i+"个数字为"+a[i]);
        }
    }
}
